#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include z_migliore\utility;


init_mp_highrise()
{
    level.zMap_AttackersSpawnOrigin = (-10415, 4005, 2320);
    level.zMap_AttackersSpawnAngles = (0, 30, 0);
    
    level.zMap_AttackersWeaponBoxOrigin = (-10065, 3990, 2345);
    level.zMap_AttackersWeaponBoxAngles = (0, 90, 0);
    
    level.zMap_MasterBotSpawnOrigin = (20475, 10015, 3136);
    level.zMap_MasterBotSpawnAngles = (0, -180, 0);
    
    level.zMap_TeleportFlags = [];
    level.zMap_TeleportFlags[level.zMap_TeleportFlags.size] = createTeleport((-8075, 6705, 2310), (0, -90, 0), (-6400, 10895, 5455), (0, 150, 0), true);
    level.zMap_TeleportFlags[level.zMap_TeleportFlags.size] = createTeleport((-7845, 6705, 2310), (0, -90, 0), (2975, 11635, 3360), (0, 55, 0), true);
    level.zMap_TeleportFlags[level.zMap_TeleportFlags.size] = createTeleport((-7845, 6350, 2310), (0, -90, 0), (-1600, 5090, 2625), (0, 0, 0), false);
    level.zMap_TeleportFlags[level.zMap_TeleportFlags.size] = createTeleport((-7845, 6024, 2310), (0, -90, 0), (-290, 2575, 3575), (0, -45, 0), true);
    
    level.zMap_DefendersSniperSpawns = [];
    level.zMap_DefendersSniperSpawns[level.zMap_DefendersSniperSpawns.size] = createAISniperSpawn((81, 5238, 3611), (0, 180, 0));
    level.zMap_DefendersSniperSpawns[level.zMap_DefendersSniperSpawns.size] = createAISniperSpawn((-1334, 10126, 2712), (0, -90, 0));
    level.zMap_DefendersSniperSpawns[level.zMap_DefendersSniperSpawns.size] = createAISniperSpawn((2269, 10095, 4064), (0, -135, 0));
    level.zMap_DefendersSniperSpawns[level.zMap_DefendersSniperSpawns.size] = createAISniperSpawn((-2858, 5140, 3216), (0, 0, 0));
    
    level.zMap_DefendersUnits = [];
    level.zMap_DefendersUnits["_sniper"] = createAIUnit("mp_body_ally_sniper_ghillie_urban", "head_allies_sniper_ghillie_urban", "barrett_fmj_heartbeat_mp", 2.0, 5);
    
    
    
    
    
    
    
    /*level.zMap_DefendersUnits = [];
    // "0_" - обычный отряд (8 чел максимум)
    // "1_" - снайперский отряд (2 чел максимум)
    // "2_" - стелс отряд (4 чел максимум)
    level.zMap_DefendersUnits["0_commander"] = createAIUnit("mp_body_us_army_assault_a", "head_us_army_a", "m4_fmj_reflex_mp", 4);
    level.zMap_DefendersUnits["0_rifleman"] = createAIUnit("mp_body_us_army_assault_b", "head_us_army_b", "m4_eotech_mp", 0);
    level.zMap_DefendersUnits["0_grenader"] = createAIUnit("mp_body_us_army_assault_c", "head_us_army_c", "m4_eotech_gl_mp", 0);
    level.zMap_DefendersUnits["0_support"] = createAIUnit("mp_body_us_army_lmg", "head_us_army_d", "m240_eotech_grip_mp", 0);
    level.zMap_DefendersUnits["0_marksman"] = createAIUnit("mp_body_army_sniper", "head_allies_us_army_sniper", "m21_fmj_mp", 0);
    level.zMap_DefendersUnits["1_sniper"] = createAIUnit("mp_body_ally_sniper_ghillie_urban", "head_allies_sniper_ghillie_urban", "cheytac_fmj_heartbeat_mp", 4);
    level.zMap_DefendersUnits["1_spotter"] = createAIUnit("mp_body_ally_sniper_ghillie_urban", "head_allies_sniper_ghillie_urban", "barrett_fmj_heartbeat_mp", 0);
    level.zMap_DefendersUnits["2_commander"] = createAIUnit("mp_body_us_army_smg", "head_us_army_f", "ump45_eotech_silencer_mp", 4);
    level.zMap_DefendersUnits["2_shooter"] = createAIUnit("mp_body_us_army_smg_b", "head_us_army_a", "mp5k_reflex_silencer_mp", 0);
    level.zMap_DefendersUnits["2_assist"] = createAIUnit("mp_body_us_army_smg_c", "head_us_army_b", "masada_eotech_silencer_mp", 0);
    
    level.zMap_DefendersSquads = [];
    level.zMap_DefendersSquads["normal"] = [];
    level.zMap_DefendersSquads["normal"][0] = "0_commander";
    level.zMap_DefendersSquads["normal"][1] = "0_rifleman";
    level.zMap_DefendersSquads["normal"][2] = "0_support";
    level.zMap_DefendersSquads["normal"][3] = "0_grenader";
    level.zMap_DefendersSquads["normal"][4] = "0_marksman";
    level.zMap_DefendersSquads["normal"][5] = "0_grenader";
    level.zMap_DefendersSquads["normal"][6] = "0_rifleman";
    level.zMap_DefendersSquads["normal"][7] = "0_rifleman";
    level.zMap_DefendersSquads["sniper"] = [];
    level.zMap_DefendersSquads["sniper"][0] = "1_sniper";
    level.zMap_DefendersSquads["sniper"][1] = "1_spotter";
    level.zMap_DefendersSquads["stealth"] = [];
    level.zMap_DefendersSquads["stealth"][0] = "2_commander";
    level.zMap_DefendersSquads["stealth"][1] = "2_shooter";
    level.zMap_DefendersSquads["stealth"][2] = "2_assist";
    level.zMap_DefendersSquads["stealth"][3] = "2_shooter";
    
    level.zMap_DefendersSpawns = [];
    level.zMap_DefendersSpawns[0] = []; // group #0 (северное здание)
    level.zMap_DefendersSpawns[0][0] = createAISpawnPoint((1585, 7447, 2824));
    level.zMap_DefendersSpawns[0][1] = createAISpawnPoint((348, 5444, 2824));
    
    level.zMap_DefendersWaypoints = [];
    level.zMap_DefendersWaypoints[0] = []; // group #0 (северное здание)
    level.zMap_DefendersWaypoints[0][0] = createWaypoint((1360, 7485, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][1] = createWaypoint((330, 7475, 2824), (0, -90, 0), 2);
    level.zMap_DefendersWaypoints[0][2] = createWaypoint((330, 7140, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][3] = createWaypoint((660, 7245, 2824), (0, -170, 0), 2);
    level.zMap_DefendersWaypoints[0][4] = createWaypoint((340, 6670, 2824), (0, -165, 0), 2);
    level.zMap_DefendersWaypoints[0][5] = createWaypoint((575, 6660, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][6] = createWaypoint((636, 6794, 2824), (0, -110, 0), 2);
    level.zMap_DefendersWaypoints[0][7] = createWaypoint((512, 6538, 2808), (0, -105, 0), 2);
    level.zMap_DefendersWaypoints[0][8] = createWaypoint((1222, 6663, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][9] = createWaypoint((1293, 6990, 2824), (0, 115, 0), 2);
    level.zMap_DefendersWaypoints[0][10] = createWaypoint((1158, 6990, 2824), (0, -90, 0), 2);
    level.zMap_DefendersWaypoints[0][11] = createWaypoint((1199, 7195, 2824), (0, -100, 0), 2);
    level.zMap_DefendersWaypoints[0][12] = createWaypoint((404, 6227, 2824), (0, 150, 0), 2);
    level.zMap_DefendersWaypoints[0][13] = createWaypoint((135, 6567, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][14] = createWaypoint((264, 5700, 2824), (0, 180, 0), 2);
    level.zMap_DefendersWaypoints[0][15] = createWaypoint((276, 5913, 2824), (0, 110, 0), 2);
    level.zMap_DefendersWaypoints[0][16] = createWaypoint((9, 5930, 2824), (0, 0, 0), 2);
    level.zMap_DefendersWaypoints[0][17] = createWaypoint((259, 5271, 2824), (0, 90, 0), 2);*/
}

createAISpawnPoint(pos)
{
    spawn_point = spawnStruct();
    spawn_point.origin = pos;
    //spawn_point.last_spawned = getTime();
    
    return spawn_point;
}

createAISniperSpawn(pos, angles)
{
    spawn_point = spawnStruct();
    spawn_point.origin = pos;
    spawn_point.angles = angles;
    spawn_point.busy = undefined;
    
    return spawn_point;
}

createAIUnit(body_model, head_model, weapon_name, weapon_delay, weapon_camo)
{
    unit = spawnStruct();
    unit.body = body_model;
    unit.head = head_model;
    unit.weapon = weapon_name;
    unit.delay = weapon_delay;
    unit.camo = weapon_camo;
    
    return unit;
}

createTeleport(pos_1, angles_1, pos_2, angles_2, recon_only)
{
    teleport = spawnStruct();
    teleport.pos1_origin = pos_1;
    teleport.pos1_angles = angles_1;
    teleport.pos2_origin = pos_2;
    teleport.pos2_angles = angles_2;
    teleport.recon_only = recon_only;
    
    return teleport;
}

createWaypoint(pos, angles, rad)
{
    waypoint = spawnStruct();
    waypoint.origin = pos;
    waypoint.angles = angles;
    waypoint.radius = rad;
    waypoint.ambushed = false;
    
    return waypoint;
}

